package src.server;

import src.config.SysConfig;

import java.net.Socket;

/**
 * @author CsCN
 * 登录验证服务
 */
public class LoginServer extends AbstractServer {
    public LoginServer() {
        super(SysConfig.LOGIN_PORT);
    }

    @Override
    public void startThread(Socket socket) {
        if (SysConfig.MYSQL_START == 1) {
            Thread thread = new LoginThread(socket);
            thread.start();
        } else {
            String rec = SocketHelper.recvString(socket);
            System.out.println("get: " + rec);
            if (rec.startsWith("login")) {
                SocketHelper.sendString(socket, "OK");
            }
        }
    }

}
